{{include file ="admin/header.tpl"}} {{include file
="admin/navibar.tpl"}} {{include file ="admin/sidebar.tpl"}}

<<script type="text/javascript">
<!--
	function save(){
		$.ajax({
	        type: "POST",
	        url: 'admin/fileedit/savefile',
	       	data: $("#dataform").serialize(),
	        success:function(data){
		        if(data == 1){
		        	 $.layer({
		                 area : ['auto','auto'],
		                 dialog : {msg:'文件修改成功!',type : 0}
		             });
		        }
		    },
	        error: function () {
	        }
	    });
	}
//-->
</script>
<link href="{{$smarty.const.WEBSITE_URL}}public/assets/pagedown/demo.css"
	rel="stylesheet">
 <script src="{{$smarty.const.WEBSITE_URL}}public/assets/layer/layer.min.js"></script>
<div class="content">

	<div class="header">
		<div class="stats">
			<p class="stat">
				<!--span class="number"></span-->
			</p>
		</div>
		<h1 class="page-title">系统文件修改</h1>
	</div>

	<div class="container-fluid">
		<div class="row-fluid">
			<div class="bb-alert alert alert-info" style="display: none;">
				<span>操作成功</span>
			</div>
			<div id="myTabContent" class="tab-content">
				<!-- 实际写文章内容的布局开始 -->
				<div class="row-fluid">
					<div class="alert alert-success span9" id="p_tip">
						<p>
						 	注:由于冲突.$textarea 代表为html的textarea标签.. 
						</p>
						<p>
						 	<strong>当前文件:</strong>{{$openfilepath}}
						</p>
					</div>
					<div class="container-fluid">
						<div class="span9">
						<form id="dataform">
							<input class="input-medium"
								type="text" placeholder="title" name="openfilepath"   value='{{$openfilepath}}'
								id="openfilepath" style="display: none;"> 
							<div class="p">
								<textarea id="wmd-input" class="textarea-14" name="text"
									tabindex="2"  rows="15">{{$filecontent}}</textarea>
							</div>
						</form>
							
						</div>
						<div class="span3 well ">
							<div class="p">
								<h3>
									<i class="icon-th-list"></i>文件列表
								</h3>
								<ul>
								 <li><a href='admin/fileedit/index?type=0&path={{$path}}'>.....</a></li>
								 {{foreach $folders as $folder}}
              						 <li><a href="admin/fileedit/index?type=0&name={{$folder}}&path={{$path}}">{{$folder}}</a></li>
            					 {{/foreach}}
								 {{foreach $files as $file}}
									 <li><a href="admin/fileedit/index?type=1&name={{$file}}&path={{$path}}">{{$file}}</a></li>
            					 {{/foreach}}
								</ul>
							</div>


							<button class="btn btn-large btn-primary" type="button" onclick="save()"
								id="p_publish">保存</button>
						</div>
						<!-- Modal -->
						<!-- Modal end -->

					</div>
				</div>

				<!-- 实际写文章内容的布局结束-->
			</div>
		</div>
		<!-- END 以下内容不需更改，请保证该TPL页内的标签匹配即可 -->
		{{include file="admin/footer.tpl" }}